package com.jeecg.demo.service.impl;
import com.jeecg.demo.service.AppUserServiceI;

import org.jeecgframework.core.common.service.impl.CommonServiceImpl;

import com.jeecg.demo.dao.IAppUserDao;
import com.jeecg.demo.entity.AppUserEntity;
import com.jeecg.demo.entity.SysUserEntity;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.io.Serializable;
import java.math.BigDecimal;

import org.jeecgframework.core.util.ApplicationContextUtil;
import org.jeecgframework.core.util.DateUtils;
import org.jeecgframework.core.util.MyClassLoader;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.web.cgform.enhance.CgformEnhanceJavaInter;

import org.jeecgframework.minidao.util.FreemarkerParseFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.jeecgframework.core.util.ResourceUtil;

@Service("appUserService")
@Transactional
public class AppUserServiceImpl extends CommonServiceImpl implements AppUserServiceI {
	@Autowired
	public IAppUserDao appUserDao = null;
	@Autowired
	private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
	
 	public void delete(AppUserEntity entity) throws Exception{
 		super.delete(entity);
 	}
 	
 	public Serializable save(AppUserEntity entity) throws Exception{
 		Serializable t = super.save(entity);
 		return t;
 	}
 	
 	public void saveOrUpdate(AppUserEntity entity) throws Exception{
 		super.saveOrUpdate(entity);
 	}
	public SysUserEntity checkAppuser(String username, String password)
			throws Exception {
		return appUserDao.findAppUserByAccountAndPassword(username, password);
	}

	@Override
	public AppUserEntity checkPhone(String phoneNum) {
		return appUserDao.checkPhone(phoneNum);
	}

	@Override
	public void updatePwd(String phoneNum, String newPwd) {
		appUserDao.updatePwd(phoneNum, newPwd);
	}

	@Override
	public AppUserEntity registerUser(AppUserEntity appUser) {
		if (oConvertUtils.isEmpty(appUser)) {
			return null;
		}

		
		return appUser;
	}

	@Override
	public String createUserName(String prefix, int bit) {
		
		return null;
	}
}